home *** CD-ROM | disk | FTP | other *** search
/ Network Support Library / RoseWare - Network Support Library.iso / apidev / tpapi.exe / EXAMPLES / KEYPASS.PAS < prev    next >
Pascal/Delphi Source File  |  1994-01-14  |  645b  |  39 lines

  1. program KEYPASS;
  2.  
  3. uses
  4.  
  5.   crt,
  6.   nwvar,
  7.   nwerror,
  8.   nwbindry;
  9.  
  10. var
  11.  
  12.   Bindery    : BinderyOBJ;
  13.   EncryptKey : TEncryptKey;
  14.   ObjectID   : OT_BinderyID;
  15.   Password   : TPassword;
  16.  
  17. begin
  18.  
  19.   Bindery.Init (true);
  20.   ObjectID := $02000001;
  21.   Password := '';
  22.  
  23.   if Bindery.GetEncryptedKey (ObjectID, Password, EncryptKey) <> SUCCESSFUL then
  24.     writeln ('Keyed functions not available')
  25.   else
  26.     begin
  27.  
  28.       if Bindery.KeyedVerifyPassword ('GUEST', OT_User, EncryptKey) = SUCCESSFUL then
  29.         writeln ('Invalid password')
  30.       else
  31.         writeln ('Password verified');
  32.  
  33.     end;
  34.  
  35.   Bindery.Done;
  36.  
  37. end.
  38.  
  39.